package com.cf.enums;

import lombok.Getter;
import org.apache.ibatis.annotations.Case;

@Getter
public enum UserRole {

    ADMIN(1, "管理员"), REGIONADMIN(2, "地域管理员"), USER(3, "普通用户");

    private int id;


    private String name;

    private UserRole(int id, String name){
        this.id = id;
        this.name = name;
    }

    public static UserRole of(int value){
        switch (value){
            case 1 : return ADMIN;
            case 2 : return REGIONADMIN;
            default: return USER;
        }
    }
}
